let envVersion = null

// 检查是否在非 H5 环境中，并且 uni.getAccountInfoSync 存在
if (typeof uni !== 'undefined' && typeof uni.getAccountInfoSync === 'function') {
    const { miniProgram } = uni.getAccountInfoSync();
    envVersion = miniProgram?.envVersion;
}

const config = envVersion ? ({
    develop: {
        SERVICE_BASE_URL: import.meta.env.VITE_SERVICE_BASE_URL
    },
    trial: {
        SERVICE_BASE_URL: 'https://tea.qingnian8.com'
    },
    release: {
        SERVICE_BASE_URL: 'https://tea.qingnian8.com'
    }
} as const)[envVersion] : {SERVICE_BASE_URL: import.meta.env.VITE_SERVICE_BASE_URL}

export const {
    SERVICE_BASE_URL
} = config